8f7639fb8a9b4f672e97e23fac386d93d572793c,src/main/java/net/blay09/mods/craftingtweaks/client/ClientProvider.java,ClientProvider,decompress,#TweakProvider#EntityPlayer#Container#Slot#boolean#,321

Before Change


        }
        dropOffMouseStack(entityPlayer, container, mouseSlot.slotNumber);
        getController().func_187098_a(container.windowId, start, 0, ClickType.PICKUP, entityPlayer);
        getController().func_187098_a(container.windowId, mouseSlot.slotNumber, 0, ClickType.PICKUP, entityPlayer);
    }

    public void compress(TweakProvider<Container> provider, EntityPlayer entityPlayer, Container container, Slot mouseSlot, boolean compressAll) {

After Change


        if (!mouseSlot.getHasStack() || !canClear(provider, entityPlayer, container, 0)) {
            return;
        }
        boolean decompressAll = compressType != CompressType.DECOMPRESS_ONE;
        // Clear the crafting grid
        clearGrid(provider, entityPlayer, container, 0, false);
        int start = provider.getCraftingGridStart(entityPlayer, container, 0);
        int size = provider.getCraftingGridSize(entityPlayer, container, 0);
        // Ensure the crafting grid is empty
        for (int i = start; i < start + size; i++) {
            if (container.inventorySlots.get(i).getHasStack()) {
                return;
            }
        }
        // Perform decompression on all valid slots
        for(Slot slot : container.inventorySlots) {
            if(compressType != CompressType.DECOMPRESS_ALL && slot != mouseSlot) {
                continue;
            }
            if(slot.inventory instanceof InventoryPlayer && slot.getHasStack() && ItemStack.areItemsEqual(slot.getStack(), mouseSlot.getStack()) && ItemStack.areItemStackTagsEqual(slot.getStack(), mouseSlot.getStack())) {
                // Move stack to crafting grid
                getController().func_187098_a(container.windowId, mouseSlot.slotNumber, 0, ClickType.PICKUP, entityPlayer);
                getController().func_187098_a(container.windowId, start, 0, ClickType.PICKUP, entityPlayer);
                for (Slot resultSlot : container.inventorySlots) {
                    // Search for result slot and grab result
                    if (resultSlot instanceof SlotCrafting && resultSlot.getHasStack()) {
                        getController().func_187098_a(container.windowId, resultSlot.slotNumber, 0, decompressAll ? ClickType.QUICK_MOVE : ClickType.PICKUP, entityPlayer);
                        break;
                    }
                }
                dropOffMouseStack(entityPlayer, container, mouseSlot.slotNumber);
                // Take remaining stack back out of the crafting grid
                getController().func_187098_a(container.windowId, start, 0, ClickType.PICKUP, entityPlayer);
                getController().func_187098_a(container.windowId, mouseSlot.slotNumber, 0, ClickType.PICKUP, entityPlayer);
            }
        }
    }